package com.wnxy.sddfp.sms.controller;

import com.wnxy.sddfp.common.result.Result;
import com.wnxy.sddfp.sms.service.ISmsService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author yellow Docter
 * @date 2024 -04-15
 * @desc
 */
@Api("手机验证码获取")
@RequestMapping("/sms")
@RestController
public class SmsController {

    @Autowired
    private ISmsService smsService;

    @GetMapping ("/code/{phone}")
    public Result getCode(@PathVariable("phone")String phone){
        String code = smsService.sendMsg(phone);
        return Result.ok("验证码获获取成功...code = " + code);
    }

}
